//导入request.js请求工具
import request from '@/utils/request.js'

//登录接口
export const userLoginService = (loginData) => {
    const params = new URLSearchParams()
    for (let key in loginData) {
        params.append(key, loginData[key]);
    }
    return request.post('/user/login', params);
}

//注册接口
export const userRegisterService = (registerData) => {
    const params = new URLSearchParams()
    for (let key in registerData) {
        params.append(key, registerData[key]);
    }
    return request.post('/user/register', params);
}

//获取用户的详细信息
export const userInfoService = () => {
    return request.get('/user/userInfo')
}

//修改密码
export const userPwdService = (data) => {
    const params = new URLSearchParams()
    for (let key in data) {
        params.append(key, data[key]);
    }
    return request.post('/user/userPwdService', params);
}